import request from "@/utils/request"
import type {
  QuestionItem,
  QuestionList,
  QuestionParams,
  LikeCollectParams,
} from "@/types/data"

export function getArticleList(params: QuestionParams) {
  return request<QuestionList>("/interview/query", "get", params)
}

export function getAricleInfo(query: { id: string }) {
  return request<QuestionItem>("/interview/show", "get", query)
}
// 点赞或者收藏
export function likeOrCollect(data: { id: string; optType: 1 | 2 }) {
  return request("interview/opt", "post", data)
}
// 获取收藏或者点赞的列表
export function getLikeCollect(data: LikeCollectParams) {
  return request<QuestionList>("/interview/opt/list", "get", data)
}
